import streamlit as st

# 侧边栏
with st.sidebar:
    st.title("控制面板")
    selected = st.selectbox("选择班级", ["一班", "二班", "三班"])
    st.slider("分数阈值", 60, 100, 75)
st.sidebar.text("测试直接添加")


# 分列布局
vertical_alignment = st.selectbox(
    "Vertical alignment", ["top", "center", "bottom"], index=2
)
left, middle, right = st. columns(3, vertical_alignment=vertical_alignment)
left.image("https://static.streamlit.io/examples/cat.jpg")
middle.image("https://static.streamlit.io/examples/dog.jpg")
right.image("https://static.streamlit.io/examples/owl.jpg")

# 卡片布局
tab1, tab2, tab3 = st.tabs(["Cat", "Dog", "Owl"])
with tab1:
     st.header("A cat")
     st.image("https://static.streamlit.io/examples/cat.jpg", width=200)
with tab2:
     st.header("A dog")
     st.image("https://static.streamlit.io/examples/dog.jpg", width=200)
with tab3:
     st.header("An owl")
     st.image("https://static.streamlit.io/examples/owl.jpg", width=200)


# 容器布局
row1 = st.columns(3)
row2 = st.columns(3)

for col in row1 + row2:
    tile = col.container(height=120)
    tile.title(":balloon:")

container = st.container(border=True)
container.write("This is inside the container - 1")
st.write("This is outside the container - 2")
container.write("This is inside too - 3")